<!-- comments begin here -->
<div id="comments">
	
	
<?php if ('open' == $post->comment_status) : ?>

	<!--<h2 class="comment-heading post-title"><?php comment_form_title( 'Leave a Reply', 'Leave a Reply to %s' ); ?></h2>
-->
	<div id="respond">

	<?php if ( get_option('comment_registration') && !$user_ID ) : ?>

		<p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in</a> to post a comment.</p>

	<?php else : ?>

		<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">

		<div class="cancel-comment-reply">
			<p><?php cancel_comment_reply_link(); ?></p>
		</div>

		<?php 
		if ($user_ID) { // user is logged in
			global $user_email;
			get_currentuserinfo();
			echo '<div class="avatar-user"><a href="http://gravatar.com/" target="_blank">'.get_avatar($user_email,16).'</a></div>';
		} elseif ($comment_author_email != "") { //no user logged in, if commenter email saved
			echo '<div class="avatar-commenter"><a href="http://gravatar.com/" target="_blank">'.get_avatar($comment_author_email,16).'</A></div>';
		} ?>

		<?php if ( $user_ID ) : ?>

			<p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>
			 | <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Log out of this account">Log out &raquo;</a></p>

		<?php else : ?>

			<p class="cform-name">
				<input type="text" name="author" id="author" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> value="<?php echo $comment_author; ?>" />
				<label for="author">Name <span class="required">*</span></label>
			</p>

			<p class="cform-mail">
				<input type="text" name="email" id="email" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> value="<?php echo $comment_author_email; ?>" />
				<label for="email">E-mail <span class="required">*</span></label>
			</p>

			<p class="cform-web">
				<input type="text" name="url" id="url" tabindex="3" value="<?php echo $comment_author_url; ?>" />
				<label for="url">Website</label>
			</p>

		<?php endif; ?>

		<p><textarea name="comment" id="comment" tabindex="4" style="height:20px" onfocus="this.style.height='150px';"></textarea></p>

		<input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" style="cursor:pointer;" class="button" />

		<?php comment_id_fields(); ?>

		<?php do_action('comment_form', $post->ID); ?>

		</form><!-- /commentform -->

	<?php endif; // If registration required and not logged in ?>
	</div><!-- /respond -->

<?php else : ?>

<!-- If comments are closed. -->

<?php endif; // if you delete this the sky will fall on your head ?>





<?php
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
	die ('Please do not load this page directly. Thanks!');

if ( post_password_required() ) { ?>
	<p class="nocomments">This post is password protected. Enter the password to view comments.</p>
	</div><!-- /comments -->

	<!-- comments end here -->
<?php
	return;
}

if ( have_comments() ) : ?>
	<!--<a href="#respond" class="alignright leave-one">Leave Comment</a>-->
	<!--<h2 class="comment-heading post-title" id="comments"><?php comments_number('No Responses', 'One Response', '% Responses' );?></h2>-->



	<ol class="commentlist">
		<?php wp_list_comments('type=comment&callback=fp_comments'); ?>
	</ol>

	<div class="navigation">
		<?php paginate_comments_links() ?>
	</div>

	<ol class="trackbacklist">
		<?php wp_list_comments('type=pingback&callback=fp_trackbacks'); ?>
	</ol>
	


<?php endif; ?>


</div><!-- /comments -->

<!-- comments end here -->